package com.sc.nft.dao;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.ActivityTaskPrize;
import com.sc.nft.mapper.ActivityTaskPrizeMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;

@Slf4j
@Repository
public class ActivityTaskPrizeDao extends ServiceImpl<ActivityTaskPrizeMapper, ActivityTaskPrize> {

    public List<ActivityTaskPrize> getByTaskId(Long taskId){
        return lambdaQuery().eq(ActivityTaskPrize::getTaskId,taskId).list();
    }
    public List<ActivityTaskPrize> getByTaskIds(List<Long>taskIds){
        return lambdaQuery().in(ActivityTaskPrize::getTaskId,taskIds).list();
    }


    public void removeByTaskId(Long taskId){
         lambdaUpdate().eq(ActivityTaskPrize::getTaskId,taskId).remove();
    }
}